package com.atguigu.config;

import feign.Logger;
import feign.Retryer;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
import reactor.util.retry.Retry;


@Configuration
public class OrderServiceConfig {

    @Bean
    Retryer retryer(){
        return  new Retryer.Default();
    }

    @Bean
    // Logger要是feign包下面的：import feign.Logger;
    Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }
    @Bean
    @LoadBalanced //负载均衡
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
